using UnityEngine;
using System.Collections;

public class AimController : MonoBehaviour {

    Plane plane;
    public int aimSpeed = 20;

	// Use this for initialization
	void Start () {
        plane = new Plane(Vector3.up, transform.position);
	
	}
	
	// Update is called once per frame
	void Update () {

        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        
        float dist;

        if (plane.Raycast(ray, out dist))
        {
            Vector3 clickPoint = ray.GetPoint(dist);
            transform.LookAt(clickPoint);
        }

	}
}
